<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>存款</title>
    <link href="res/style.css" rel="stylesheet">
    <script src="http://47.106.66.89:8080/js/vue.min.js"></script>
    <script src="http://47.106.66.89:8080/js/axios.min.js"></script>
</head>
<body>
<div id="app" class="flex">
    <main>
        <header class="flex">
            <div>
                <h3>源辰银行</h3>
                <small>ycinfo bank</small>
            </div>
            <div id="contact">
                <div>客服电话: 8888</div>
                <div>网址: www.ycinfo.bank.com</div>
            </div>
        </header>
        <div class="msg">
            倒计时: <h2>32</h2> 秒
        </div>
        <div id="pane" class="flex">
            <div class="btns">
                <a class="hidden">占位</a>
                <a class="hidden">占位</a>
                <a class="hidden">占位</a>
            </div>
            <div id="info">
                <h2>存款服务</h2>
                <form action="main.html">
                    <input placeholder="存入金额" type="number" v-model="money"><br>
                    <div class="msg center">请确认存入金额！</div>
                </form>
            </div>
            <div class="btns">
                <a class="hidden">占位</a>
                <a class="hidden">占位</a>
                <a class="right" @click="deposit">确定</a>
                <a href="main.html" class="right">返回</a>
            </div>
        </div>
    </main>
</div>
<script>
    let app = new Vue({
        el:"#app",
        data: {
            money:0
        },
        methods:{
            deposit(){
                let p = new URLSearchParams();
                p.append("money",this.money);
                axios.post(
                    "bank/deposit",
                    p
                ).then(resp=>{
                    if(resp.data > 0){
                        alert("存款成功")
                    }else {
                        alert("存款失败，系统错误");
                    }
                });
                console.log(this.money);
            }
        },
        created(){

        }
    });
</script>
</body>
</html>
